home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / haziran / 19 / setup.exe / data.z / usb_diag_lib.h < prev    next >
C/C++ Source or Header  |  2001-04-11  |  1KB  |  43 lines

  1. #ifndef _USB_DIAG_LIB_H_
  2. #define _USB_DIAG_LIB_H_
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. #include "../../include/windrvr.h"
  9.  
  10. enum {MAX_BUFFER_SIZE = 4096};
  11.  
  12. typedef DWORD (*READ_PIPE_FUNC)(HANDLE hDevice, PVOID pBuffer, DWORD dwSize);
  13. typedef VOID (*PROCESS_DATA_FUNC)(PVOID pBuffer, DWORD dwSize, PVOID pContext);
  14. typedef VOID (*STOP_PIPE_FUNC)(HANDLE hDevice);
  15.  
  16. typedef struct  
  17. {
  18.     READ_PIPE_FUNC read_pipe_func;
  19.     STOP_PIPE_FUNC stop_pipe_func;
  20.     HANDLE hDevice;
  21.     DWORD dwPacketSize;
  22.     PROCESS_DATA_FUNC process_data_func; // if NULL call PrintHexBuffer
  23.     PVOID pContext;
  24.     BOOL   fStopped;
  25.     HANDLE hThread;
  26. } USB_LISTEN_PIPE;
  27.  
  28. BOOL USB_Get_WD_handle(HANDLE *phWD);
  29. void USB_Print_device_info(DWORD dwVendorId, DWORD dwProductId);
  30. void USB_Print_all_devices_info();
  31. void USB_Print_device_Configurations();
  32.  
  33. void PrintHexBuffer(PVOID pBuffer, DWORD dwBytes);
  34. DWORD GetHexBuffer(PVOID pBuffer, DWORD dwBytes);
  35. void CloseListening(USB_LISTEN_PIPE *usbReadPipe);
  36. void ListenToPipe(USB_LISTEN_PIPE *usbReadPipe);
  37.  
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41.  
  42. #endif
  43.